//
//  CommunityTableViewCell.m
//  Youhuiju
//
//  Created by yutenys on 16/7/29.
//  Copyright © 2016年 yutenys. All rights reserved.
//

#import "CommunityTableViewCell.h"

@interface CommunityTableViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *goodsImg;

@property (weak, nonatomic) IBOutlet UILabel *detailLabel;

//适配
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *imgHig;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *detailLabelTop;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *detailLabelLeading;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *detailLabelTrailing;



@end


@implementation CommunityTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.imgHig.constant = 223 * FitH;
    
    self.detailLabel.font = [UIFont systemFontOfSize:13 * FitH];
    self.detailLabelTop.constant = 12 * FitH;
    self.detailLabelLeading.constant = 12 * FitW;
    self.detailLabelTrailing.constant = 12 * FitW;
    
    // 设置字体间每行的间距
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    paragraphStyle.lineHeightMultiple = 15.0f * FitH;
    paragraphStyle.maximumLineHeight = 15.0f * FitH;
    paragraphStyle.minimumLineHeight = 15.0f * FitH;
    paragraphStyle.lineSpacing = 4.0f * FitH;// 行间距
    NSString *string = @"鲍鱼具有滋阴补阳，止咳通淋的功效，是一种补而不燥的海产，吃后没有牙痛，流鼻血等副作用。《食疗本草》记载，鲍鱼“入肝通瘀，入肠涤垢，不伤元气。壮阳，生百脉”。";
    NSDictionary *ats = @{
                          NSParagraphStyleAttributeName : paragraphStyle,
                          };
    self.detailLabel.attributedText = [[NSAttributedString alloc] initWithString:string attributes:ats];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
